﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Text;
using Zj.HttpCodeDemo.Domain.Core;

namespace Zj.HttpCodeDemo.Repository.Models.Mapping
{
    public class TodoMap
        :EntityTypeConfiguration<Todo>
    {
        public TodoMap()
        {
            //table
            this.ToTable("Todo","dbo");

            //keys
            HasKey(t => t.Id);

            //properties
            this.Property(t => t.Id)
                .HasColumnName("Id")
                .IsRequired();

            this.Property(t => t.Title)
                .HasColumnName("Title")
                .HasMaxLength(30)
                .IsRequired();
        }
    }
}
